<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0" charset="UTF-8">
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <title>Title</title>
    <style>
        .login-form {
            position: absolute;
            top: 30%;
            -webkit-transform: translateY(-50%);
            -moz-transform: translateY(-50%);
            -ms-transform: translateY(-50%);
            -o-transform: translateY(-50%);
            transform: translateY(-50%);
            min-height: 300px;
            height: auto;
        }
        body{
            background: url(img/02.jpg) no-repeat;
            background-size:100%;
        }

    </style>

</head>
<body>

<div class="container-fluid " >
    <div class="login-form  col-lg-4 col-lg-offset-4  col-sm-6 col-sm-offset-3 col-xs-8 col-xs-offset-2 ">
        <div class="row">

            <div class="col-md-6 column">
                <div>
                    <img src="img/01.jpg" class="img-rounded" width="200" height="100">
                </div>
                <div>
                    <br>
                    <strong>欢迎使用阳光物流管理系统 </strong>

                </div>
                <div>
                    <br>
                    <b> 货通天下 </b><b> 信满四方 </b>
                    <p></p>
                    <b> 物流天下 </b><b> 服务无限 </b>
                    <br>
                </div>
                <div>
                    <br>
                    <strong>还没有账号？</strong><a href="#">立即注册。</a><br>
                </div>
            </div>

            <div class="col-md-6 column">
                <div>
                    <strong>注册：</strong>
                    <p>因为你有你的人生，我有我的旅程--叶倩文</p>
                </div>
                <form role="form" method="post" action="/login/check">
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="账户名" name="username">
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control" placeholder="密码" name="password">
                    </div>
                    <div class="row">
                        <div class="col-md-6 column">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="验证码" name="verifycode">
                            </div>
                        </div>
                        <div class="col-md-6 column">
                            <button type="button" class="btn btn-default" >默认按钮</button>
                        </div>
                    </div>
                    <div>
                        <button class="layui-btn" onclick="insert_1()" >添加</button>
                    </div>
                </form>
            </div>

        </div>
    </div>
</div>
<script>
    function insert_1(){
      var $ = layui.$;
      var cname =$("#cname").val();
      var cphone =$("#cphone").val();
      console.log(cname);
      var data ={
        "cname":cname,
        "cphone":cphone,
      }
      var url ="http://localhost:8080/add";
      $.ajax({
        type:"get",
        url:url,
        async:false,
        cache:false,
        data:data,
        success: function(data,textStaus,jqXHR){

          if(data.code === 200){
            alert("插入成功了");
          }else{
            alert(data.message);
          }
        },
        error:function (XMLHttpRequest, textStatus, errorThrown) {

          alert(typeof(errorThrown));
        }
      });
    }
</script>

<script src="https://code.jquery.com/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
